﻿@using SlamDunk.CMS.BLL
@using SlamDunk.CMS.Model
@using SlamDunk.CMS.Model.ViewModel
@{
    ArticleBll articleBll = new ArticleBll();
    ChannelBll channelBll = new ChannelBll();
    List<ChannelView> channelList = channelBll.GetModelList(1).Where(x => x.IsNavigator == true).Select(x => x.ToViewModel()).ToList();
    //获取联系我们
    ArticleViewForRead contractUs = articleBll.GetModelList(19).FirstOrDefault() == null ? new ArticleViewForRead() : articleBll.GetModelList(19).FirstOrDefault().ToViewModel();
}
<!--顶部导航-->
<div class="Top_topcon">
    <div class="Top_topmid">
        <div class="Top_topright">
            <ul class="Top_toprigT f1 c1">
                <li><a href="http://www.hit.edu.cn">哈工大首页</a></li>
                <span>|</span>
                <li><a href="http://som.hit.edu.cn">学院首页</a></li>
                <span>|</span>
                <li><a href="http://zsb.hit.edu.cn">工大招生网</a></li>
                <span>|</span>
                <li><a href="javascript:void(0);" onclick="this.style.behavior = 'url(#default#homepage)'; this.setHomePage('http://www.baidu.com');">设为首页</a></li>
                <span>|</span>
                <li><a href="javascript:window.external.addfavorite('http://www.baidu.com', '百度')">加入收藏</a></li>
            </ul>
            <div class="Top_toprigB">
                <div class="Top_toprigBL">
                    <input id="txtSearch" name="" type="text" class="search_txt" value="请输入搜索内容" onfocus="if(value==defaultValue){value='';this.style.color='#000'}" onblur="if(!value){value=defaultValue;this.style.color='#999'}" style="color: #999999;" />
                </div>
                <input type="button" class="Top_toprigBR_bnt f1" value="搜 索" onclick="searchList();" />
            </div>
        </div>
    </div>
    <div class="clear"></div>
</div>
<!--导航条-->
<div class="navBar">
    <ul class="nav clearfix">
        <li id="m1" class="m on">
            <h3><a href="/">网站首页</a></h3>
        </li>
        @foreach (ChannelView channel in channelList)
        {
            <li id="m3" class="m">
                <h3><a href="@channel.Url">@channel.ChannelName</a></h3>
                @{List<ChannelView> subChannelList = channelBll.GetModelList(channel.Id).Where(x => x.IsNavigator == true).Select(x => x.ToViewModel()).ToList();}
                @if (subChannelList.Count > 0)
                {
                    <div class="sub">
                        <ul class="subul menu1">
                            @foreach (ChannelView subChannel in subChannelList)
                            {
                                <li><a class="a1" href="@subChannel.Url">@subChannel.ChannelName</a></li>
                            }
                        </ul>
                    </div>
                }
            </li>
        }
        <li id="m8" class="m">
            <h3><a href="@contractUs.Url">联系我们</a></h3>
        </li>
    </ul>
</div>
<script type="text/javascript">
    jQuery(".nav").slide({
        type: "menu", //效果类型
        titCell: ".m", // 鼠标触发对象
        targetCell: ".sub", // 效果对象，必须被titCell包含
        delayTime: 300, // 效果时间
        triggerTime: 0, //鼠标延迟触发时间
        returnDefault: true  //返回默认状态
    });
</script>
